package com.ffcs.ffxtc.domain.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 组件类目表
 * </p>
 *
 * @author 张正兴
 * @since 2024-04-13
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("dv_category")
@Schema(name = "DvCategory", description = "组件类目表")
public class DvCategory extends Model<DvCategory> {

  private static final long serialVersionUID = 1L;

  @TableField("deleted")
  @TableLogic
  private Long deleted;

  @TableId(value = "id", type = IdType.ASSIGN_ID)
  private Integer id;

  @TableField("name")
  @ExcelProperty("名字")
  private String name;

  @TableField("path")
  @ExcelProperty("路径")
  private String path;

  @TableField("pid")
  private Integer pid;

  @TableField("icon")
  private String icon;

  @Schema(description = "排序字段")
  @TableField("\"order\"")
  private Integer order;

  public static final String DELETED = "deleted";

  public static final String ID = "id";

  public static final String NAME = "name";

  public static final String PATH = "path";

  public static final String GROUP = "group";

  public static final String PID = "pid";

  public static final String ICON = "icon";

  public static final String ORDER = "order";

  @Override
  public Serializable pkVal() {
    return this.id;
  }
}
